<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!-- 节点的优点 -->
    <div>我是div</div>
    <span>我是span</span>
    <ul>
        <li>我是li</li>
        <li>我是li</li>
        <li>我是li</li>
        <li>我是li</li>
    </ul>
    <div class="demo">
        <div class="box">
            <span class="erweima">×</span>
        </div>

        <script>
            //父节点
            var erweima = document.querySelector('.erweima');
            console.dir(erweima);
            console.log(erweima.parentNode);

            // 2.子节点 返回值是集合
            var box = document.querySelector('.box');
            console.log(box.childNodes);
            console.log(box.children); //常用
            console.log(box.children[0]);
        </script>
    </div>
</body>
</html>